import { constantRoutes } from '@/router'

// 这个仓库 用于管理 路由规则这个响应式数据
const state = {
  routes: constantRoutes // 当前用户的所有路由规则(静态+动态)
}

const getters = {}

const mutations = {
  setRoutes(state, otherRoutes) {
    state.routes = [...constantRoutes, ...otherRoutes]
  }
}

const actions = {}

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}
